package pers.jason.wppm.api.entity;


import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @ClassName: PageSupport
 * @Author: JZH
 * @Date: 2018/12/24 15:45
 */
@Data
public class PageSupport {

    @NotNull(message = "参数page不能为空")
    private Integer page;

    @NotNull(message = "参数rows不能为空")
    private Integer rows;

    private String sortColumn;

    private Sort sort = Sort.ASC;

    public enum Sort {
        ASC {
            @Override
            public String getName() {
                return "asc";
            }
        },
        DESC {
            @Override
            public String getName() {
                return "desc";
            }
        };

        public abstract String getName();


    }
}
